import { RoleMessageType } from "../enum";
import { BaseMessage, BaseMessageConfig } from "./base";

export interface ReceivingChatMessageConfig extends Omit<BaseMessageConfig, "roleMessageType"> {
    roleMessageType?: RoleMessageType.AgentReceiving;
}

export interface SendingChatMessageConfig extends Omit<BaseMessageConfig, "roleMessageType"> {
    roleMessageType?: RoleMessageType.AgentSending;
}

/**
 * 聊天信息类
 */
export class ChatMessage extends BaseMessage {
    constructor(info: BaseMessageConfig) {
        super(info);
    }
}

/**
 * Agent 接受的消息类
 */
export class ReceivingChatMessage extends ChatMessage {
    constructor(info: ReceivingChatMessageConfig) {
        const roleMessageType = RoleMessageType.AgentReceiving;
        super({ ...info, roleMessageType });
    }
}

/**
 * Agent 发送的消息类
 */
export class SendingChatMessage extends ChatMessage {
    constructor(info: SendingChatMessageConfig) {
        const roleMessageType = RoleMessageType.AgentSending;
        super({ ...info, roleMessageType });
    }
}
